Skip to content

Add a Redis core#273

Merged
shaypal5 merged 6 commits into
masterfrom
redis
Jul 7, 2025
Merged

Add a Redis core#273
shaypal5 merged 6 commits into
masterfrom
redis

Conversation

@shaypal5

@shaypal5 shaypal5 commented Jul 5, 2025

Copy link
Copy Markdown
Member

No description provided.

@shaypal5 shaypal5 marked this pull request as ready for review July 5, 2025 22:24
@shaypal5 shaypal5 requested review from Borda and Copilot July 5, 2025 22:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Redis-based caching support to Cachier, introducing a new Redis core implementation, accompanying tests, documentation updates, and CI integration.

  • Implements _RedisCore in src/cachier/cores/redis.py and wires it into the cachier decorator.
  • Adds comprehensive tests for the Redis core under tests/test_redis_core.py and CI config for Redis.
  • Updates type definitions, examples, README, and CI workflows to support the new Redis backend.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/cachier/cores/redis.py New Redis core implementation for caching logic
src/cachier/core.py Registers redis_client param and redis backend
src/cachier/_types.py Extends Backend and defines RedisClient type
tests/test_redis_core.py Tests covering Redis core features
tests/redis_requirements.txt Test dependencies for Redis (redis, pandas, birch)
examples/redis_example.py Example usage of the Redis backend
README.rst Documentation section for Redis core
.github/workflows/ci-test.yml CI pipeline steps and matrix for Redis tests
Comments suppressed due to low confidence (3)

src/cachier/cores/redis.py:208

  • There are no tests covering clear_being_calculated; consider adding a test in tests/test_redis_core.py to ensure entries marked as being calculated are correctly reset.
    def clear_being_calculated(self) -> None:

src/cachier/core.py:109

  • The decorator signature does not include a key_prefix parameter, so passing key_prefix to the Redis backend (as shown in the README) will cause an unexpected argument error. Consider adding key_prefix to the decorator parameters and passing it to _RedisCore.
def cachier(

examples/redis_example.py:57

  • [nitpick] Calling setup_redis_client() directly may return None and cause a MissingRedisClient error. It’s better to pass the callable or guard the decorator application to ensure a valid client is provided.
    @cachier(backend="redis", redis_client=setup_redis_client())

Comment thread tests/test_redis_core.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@shaypal5 shaypal5 merged commit e9db66d into master Jul 7, 2025
42 checks passed
@shaypal5 shaypal5 deleted the redis branch July 7, 2025 13:21
@shaypal5 shaypal5 added area: ci GitHub Actions, pre-commit, codecov, or automation config. area: core-api Decorator API, cache semantics, or public behavior. area: docs README, examples, contributor docs, or repo documentation. area: mongo MongoDB backend or MongoDB test services. area: packaging Build metadata, package configuration, publishing, or requirements files. area: pickle Pickle/file-system backend. area: redis Redis backend or Redis test services. area: tests Test suite, fixtures, coverage, or local test scripts. CI documentation github_actions Pull requests that update GitHub Actions code linting & style outcome: merged Merged into the repository. source: human Opened directly by a human contributor. testing and development labels Jun 13, 2026
@shaypal5 shaypal5 added type: ci GitHub Actions, CI configuration, or automation workflow change. type: deps Dependency or lockfile update. type: docs Documentation-only or documentation-focused change. type: feature Adds or materially changes user-facing functionality. type: tests Tests, fixtures, test coverage, or test data. and removed documentation testing and development CI linting & style github_actions Pull requests that update GitHub Actions code type: docs Documentation-only or documentation-focused change. type: tests Tests, fixtures, test coverage, or test data. type: deps Dependency or lockfile update. area: redis Redis backend or Redis test services. area: packaging Build metadata, package configuration, publishing, or requirements files. area: docs README, examples, contributor docs, or repo documentation. area: tests Test suite, fixtures, coverage, or local test scripts. area: ci GitHub Actions, pre-commit, codecov, or automation config. labels Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core-api Decorator API, cache semantics, or public behavior. area: mongo MongoDB backend or MongoDB test services. area: pickle Pickle/file-system backend. complex issue enhancement outcome: merged Merged into the repository. source: human Opened directly by a human contributor. type: ci GitHub Actions, CI configuration, or automation workflow change. type: feature Adds or materially changes user-facing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants